package edu.hawaii.senin.iclouds.simple;

import java.io.File;
import java.io.IOException;

/**
 * This method incorporates simple cloud simulation scenario. It will load specified cloud config
 * and parse it. Next fixture will be generated and dumped into C:/snapshot.txt.
 * 
 * @author Administrator
 * 
 */
public class CloudSimulation {

  /**
   * Runs the simulation.
   * 
   * @param args command line parameters.
   */
  public static void main(String[] args) {

    String data = args[0];
    String log = args[1];

    Cloud model = new Cloud();

    try {
      model.loadConfig(data);
      model.setLogFile(new File(log));
      if (model.modelReady()) {
        new Thread(model).start();
      }
    }
    catch (ReadConfigException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }

}
